<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page language="java" import="java.util.*" %>
<%@  page import   =   "java.text.*"   %>
<%@  page import   =   "java.sql.*"   %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="tablecloth/tablecloth.css" rel="stylesheet" type="text/css" media="screen" />

<link href="<%= request.getContextPath()%>/css/montview.css" rel="stylesheet" type="text/css"/>
<LINK href="<%=request.getContextPath()%>/css/oa.css" rel=stylesheet />
<LINK href="<%=request.getContextPath()%>/css/common.css" rel=stylesheet />
<link href="<%= request.getContextPath()%>/css/calender.css" rel="stylesheet" type="text/css">
<script src="<%=request.getContextPath()%>/js/calendar.js" language="javascript"></script>
<script src="<%=request.getContextPath()%>/js/check_char.js" language="javascript"></script>
<script src="<%=request.getContextPath()%>/js/ajax.js" language="javascript"></script>
<script src="<%=request.getContextPath()%>/js/mootools-1.2.1-core-yc.js" language="javascript"></script>
<script language="javascript" src="<%= request.getContextPath()%>/js/calender.js" type=""></script>
<script type="text/javascript" src="<%= request.getContextPath()%>/js/jquery-1.6.min.js"></script>

<style>
body { margin:0; padding:0; background:#f1f1f1; font:70% Arial, Helvetica, sans-serif; color:#555; line-height:150%; text-align:left; }
a { text-decoration:none; color:#057fac; }
a:hover { text-decoration:none; color:#999; }
h1 { font-size:140%; margin:0 20px; line-height:80px; }
h2 { font-size:120%; }
#container { margin:0 auto; background:#fff; padding-bottom:20px; width:100%; hight:100%;}
#content { margin:0 20px;width:100%;hight:100%; }
p.sig { margin:0 auto; width:100%; padding:1em 0; }
form { margin:1em 0; padding:.2em 20px; background:#eee; }
</style>

</head>


<script type="text/javascript">
var tmrID1;
var tmrID2;



var change=1;


function doajax(){
  try{
   content1_1_ajax();
   setTimer1();
  }catch(err){
   alert(err);
  }
}

function setTimer1(){
   clearTimeout(tmrID1); 
   tmrID1=setTimeout(doajax,4000);
}
function setTimer(){
   // doajax();
   clearTimeout(tmrID2); 
   tmrID2=setTimeout(change_div,10000);
}

function doReady(){
   setTimer();
   setTimer1();
}

function content1_1_ajax(){
var select_num_1=document.getElementById("select_num_1").value;
var url="<%=request.getContextPath()%>/SanAction.do?action=content1_1";
var myAjax = new Ajax1(url,{method:'POST',onComplete:function(){
  var data = JSON.decode(this.req.responseText);
  if(data != null){
  var sum=data.length;
  var html_before_start='<table cellspacing="0" cellpadding="0" width="100%" hight="100%" style="font-size:25PX">';
  var html_start=' <tr><th>总呼入</th><th>应答数</th><th>排队呼叫</th><th>放弃数</th><th>呼出数</th><th>应答率</th><th>服务水平</th></tr>'
  var html_end='</table>'
  var html_middle_1="";
  var html_middle="";
  for(i=0;i<data.length; i++){
	            var temp = data[i];
	            var content1_1_1=temp.content1_1_1;
			    var content1_1_2=temp.content1_1_2;
				var content1_1_3=temp.content1_1_3;
				var content1_1_4=temp.content1_1_4;
				var content1_1_5=temp.content1_1_5;
				var content1_1_6=temp.content1_1_6;
				var content1_1_7=temp.content1_1_7;
				html_middle_1='<tr>'+
				'<td>'+content1_1_1+'</td>'+
				'<td>'+content1_1_2+'</td>'+
				'<td>'+content1_1_3+'</td>'+
				'<td>'+content1_1_4+'</td>'+
				'<td>'+content1_1_5+'</td>'+
				'<td>'+content1_1_6+'</td>'+
				'<td>'+content1_1_7+'</td>'+
				'</tr>'
				 html_middle += html_middle_1;
				}
	 document.getElementById("content1_1").innerHTML= html_before_start+html_start+html_middle+html_end ; 
   }
}
})
}

function content1_2_ajax(){
var quanti=document.getElementById("quanti");
var url="";
if(quanti.checked==true){
url="<%=request.getContextPath()%>/SanAction.do?action=content1_2";
}else{
var zuzhi=document.getElementsByName("zuzhi");
var condition1="";
for(var a=0;a<zuzhi.length;a++){
  if(zuzhi[a].checked==true){
    condition1=condition1+zuzhi[a].value+",";
  }
}
url="<%=request.getContextPath()%>/SanAction.do?action=content1_2;
}
var myAjax = new Ajax1(url,{method:'POST',onComplete:function(){
  var data = JSON.decode(this.req.responseText);
  if(data != null){
  var sum=data.length;
  var html_before_start='<table cellspacing="0" cellpadding="0" width="100%" hight="100%" style="font-size:25PX;text-align:center">';
  var html_start=' <tr><th>坐席</th><th>坐席状态</th><th>总通话</th><th>IN</th><th>OUT</th><th>总通话时间</th><th>开始签入</th><th>最终签入</th></tr>'
  var html_end='</table>'
  var html_middle_1="";
  var html_middle="";
  for(i=0;i<data.length; i++){
	            var temp = data[i];
	            var content1_2_1=temp.content1_2_1;
			    var content1_2_2=temp.content1_2_2;
				var content1_2_3=temp.content1_2_3;
				var content1_2_4=temp.content1_2_4;
				var content1_2_5=temp.content1_2_5;
				var content1_2_6=temp.content1_2_6;
				var content1_2_7=temp.content1_2_7;
				var content1_2_8=temp.content1_2_8;
				html_middle_1='<tr>'+
				'<td>'+content1_2_1+'</td>'+
				'<td>'+content1_2_2+'</td>'+
				'<td>'+content1_2_3+'</td>'+
				'<td>'+content1_2_4+'</td>'+
				'<td>'+content1_2_5+'</td>'+
				'<td>'+content1_2_6+'</td>'+
				'<td>'+content1_2_7+'</td>'+
				'<td>'+content1_2_8+'</td>'+
				'</tr>'
				 html_middle += html_middle_1;
				}
	 document.getElementById("content1_2").innerHTML= html_before_start+html_start+html_middle+html_end ; 
   }
}
})
}




function changediv(a){
var div=document.getElementById(a);
if(div.style.display=="block"){
       div.style.display="none";
   }else if(div.style.display=="none"){
        div.style.display="block";
   } 
}
</script>
<%
			List list1_1_1=(List)request.getAttribute("list1_1_1");
			List list1_1_2=(List)request.getAttribute("list1_1_2");
			List list1_select1=(List)request.getAttribute("list1_select1");
			List list2_select1=(List)request.getAttribute("list2_select1");
			
			List list_num_1=(List)request.getAttribute("list_num_1");
			
 %>

<body onLoad="doReady()">

<!-- --------------------------------------------------------content1-------------------------------------------------------------------- -->

<div id="content1" style="display:block">
    <table>
    

    <tr onDblClick="changediv('div_page1')">
      <td style="background:white" colspan=3 id="content1_1">
    
    <table cellspacing="0" cellpadding="0" width="100%" hight="100%" style="font-size:25PX">
    <tr>
      <th>总呼入数</th>
      <th>应答数</th>
      <th>排队呼叫</th>
      <th>放弃数</th>
      <th>呼出数</th>
      <th>应答率</th>
      <th>服务水平率</th></tr>
     
    <%
      if(list1_1_1!=null){
        for(int i=0;i<list1_1_1.size();i++){
                Map map=(Map)list1_1_1.get(i);
                Object content1_1_1=(Object)map.get("content1_1_1");
                Object content1_1_2=(Object)map.get("content1_1_2");
                Object content1_1_3=(Object)map.get("content1_1_3");
                Object content1_1_4=(Object)map.get("content1_1_4");
                Object content1_1_5=(Object)map.get("content1_1_5");
                Object content1_1_6=(Object)map.get("content1_1_6");
                Object content1_1_7=(Object)map.get("content1_1_7");
		%> 	
    <tr>
    <td><%= content1_1_1%></td>
    <td><%= content1_1_2%></td>
    <td><%= content1_1_3%></td>
    <td><%= content1_1_4%></td>
    <td><%= content1_1_5%></td>
    <td><%= content1_1_6%></td>
    <td><%= content1_1_7%></td>
    </tr>
		<%		
        }
      }
     %> 

   
    </table>
    
    </td></tr>
    <tr><td style="background:white" colspan=3 id="content1_2">
    <table cellspacing="0" cellpadding="0" width="100%" hight="100%" style="font-size:25PX">
      <tr>
        <th>坐席</th>
        <th>坐席状态</th>
        <th>总通话</th>
        <th>IN</th>
        <th>OUT</th>
        <th>总通话时间</th>
        <th>开始签入</th>
        <th>最终签入</th>
      </tr>
      
    <%
      if(list1_1_2!=null){
        for(int i=0;i<list1_1_2.size();i++){
                Map map=(Map)list1_1_2.get(i);
                Object content1_2_1=(Object)map.get("content1_2_1");
				Object content1_2_2=(Object)map.get("content1_2_2");
				Object content1_2_3=(Object)map.get("content1_2_3");
				Object content1_2_4=(Object)map.get("content1_2_4");
				Object content1_2_5=(Object)map.get("content1_2_5");
				Object content1_2_6=(Object)map.get("content1_2_6");
				Object content1_2_7=(Object)map.get("content1_2_7");
				Object content1_2_8=(Object)map.get("content1_2_8");
		%> 	
    <tr>
    <td><%= content1_2_1%></td>
    <td><%= content1_2_2%></td>
    <td><%= content1_2_3%></td>
    <td><%= content1_2_4%></td>
    <td><%= content1_2_5%></td>
    <td><%= content1_2_6%></td>
    <td><%= content1_2_7%></td>
    <td><%= content1_2_8%></td>
    </tr>
		<%		
        }
      }
     %> 

      
    </table></td></tr>
    </table>
</div>



</body>
</html>
